package HadoopWithSpark.class1st

/**
 * @Author TheKernel
 * @Date 2019/9/25 2:42 下午
 * @Version 1.0
 * @Description 1.3 条件语句
 */
object ConditionalStatement {

  def main(args: Array[String]): Unit = {
    var score: Double = 99
    val res1 = if (score > 90) "成绩优秀" else "还需努力!"
    println(res1)  // 成绩优秀

    val i = 8
    val res2 = if (i > 8) i
    println(res2)  // ()

    score = 76
    val res3 = {
      if (score >= 60 && score < 70) "及格"
      else if (score >= 70 && score < 80) "中等"
      else if (score >= 80 && score < 90) "良好"
      else "优秀"
    }
    println(res3)  // 中等
  }

}
